<script type="text/javascript">
    $(document).ready(function(){
        $("#editEmployeeForm").validate({
            rules: {
                phone:{
                    number: true,
                    minlength: 10,
                    maxlength: 10
                },
                phone1: {
                    number: true,
                    minlength: 3,
                    maxlength: 3
                },
                phone2: {
                    number: true,
                    minlength: 3,
                    maxlength: 3
                },
                phone3: {
                    number: true,
                    minlength: 4,
                    maxlength: 4
                },
                email: "email",
                password: {
                    minlength: 5
                },
                password_confirmation: {
                    minlength: 5,
                    equalTo: "#password"
                }
            },
        });               
  });
</script>

<h3><%= @employee.first_name + " " + @employee.last_name %></h3>
<div style="line-height: 27px;">
<% form_remote_tag :url => {:action => "edit_employee", :id => params[:id]}, :html => {:id => "editEmployeeForm"} do %>
    <table style="margin:auto;">
        <tr>
            <td valign="top">
        	    Phone number
	        </td>
	        <td>	      
                <%= text_field_tag :phone, @employee.phone, :size => 30, :style => "margin: 0px;" %>
	        </td>
	    </tr>
	    <tr>
	        <td valign="top">
        	    Email
        	</td>
        	<td>
            	<%= text_field_tag :email, @employee.email, :size => 30 %>
        	</td>
	    </tr>
	    <tr>
	        <td valign="top">
            	New password
        	</td>
        	<td>    	
            	<%= password_field_tag :password, "", :size => 30 %>
        	</td>
	    </tr>
	    <tr>
	        <td valign="top">
	            Confirm password
            </td>
            <td>
            	<%= password_field_tag :password_confirmation, "", :size => 30 %>
        	</td>
	    </tr>
	    <tr>
	        <td valign="top">
	            Other information:
            </td>
            <td>
                <%= text_area_tag :other_info, @employee.other_info, :cols => 30, :rows => 6 %>
                <%=  hidden_field_tag 'act', 'edit_employee' %>
                <% if params[:redir] %>
                    <%=  hidden_field_tag 'redir', params[:redir] %>
                <% end %>
            </td>
	    </tr>
    </table>

	<%= submit_tag "Save", :class => "submit" %>
<% end %>
</div>

